import time
import RPi.GPIO as GPIO
led_pin = 19
button_pin=31
high_pin=33
GPIO.setmode(GPIO.BOARD)
GPIO.setup(led_pin, GPIO.OUT)
GPIO.setup(high_pin, GPIO.OUT)
GPIO.output(high_pin, GPIO.HIGH)
GPIO.setup(button_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
try:
    while 1:
        if GPIO.input(button_pin):
            GPIO.output(led_pin, GPIO.HIGH)
            time.sleep(0.1)
            print("off")
        else:
            GPIO.output(led_pin, GPIO.LOW)
            time.sleep(0.1)

except KeyboardInterrupt:
    GPIO.output(led_pin, GPIO.LOW)
    GPIO.cleanup()
print("done")
